package cn.opopopo.design_pattern_learn.结构型.decorator.demo1;

/**
 * 装饰器基类，实现 Coffee 接口，持有一个 Coffee 引用
 */
public abstract class CoffeeDecorator implements Coffee {
    protected Coffee coffee;

    public CoffeeDecorator(Coffee coffee) {
        this.coffee = coffee;
    }

    @Override
    public double cost() {
        return coffee.cost();  // 默认转发
    }

    @Override
    public String getDescription() {
        return coffee.getDescription(); // 默认转发
    }
}